//
// Created by lymk on 2021/8/6.
//

#ifndef GAME2D_UTILS_H
#define GAME2D_UTILS_H
#include "string"
#include "windows.h"
struct PicData{
    unsigned char* data;
    int width;
    int height;
    int nrChannels;
    PicData(){
        data = nullptr;
        width = 0;
        height = 0;
        nrChannels = 0;
    }
    PicData(unsigned char* adata,
            int awidth,
            int aheight,
            int anrChannels){
        data = adata;
        width = awidth;
        height = aheight;
        nrChannels = anrChannels;
    }
};
PicData LoadPNG(std::string path);
class CoolUtil{
    bool flag;//false 冷却中 true 冷却完毕
    double COOL_TIME;
    double now_cool_time;
public:
    CoolUtil(double cool_size):COOL_TIME(cool_size),now_cool_time(cool_size),flag(false){}
    void Update(double DeltaSeconds);
    bool GetFlag(){return flag;}
    void ReSet(){now_cool_time = COOL_TIME;flag = false;}
    void SetCoolTime(double inp){
        COOL_TIME = inp;
        ReSet();
    }
};
float Round_P(float input);
struct RenderUtils{
    HDC bufDC;
    HDC tmpDC;
    int dcWidth;
    int dcHeight;
};
#endif //GAME2D_UTILS_H
